package io.linfeng.service.im.entity;

import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 *
 * @author RJF
 * @since 2024-05-11
 */
@TableName("tm_message_record")
@Data
public class MessageRecordEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 聊天记录ID
     */
    @TableId("TM_MESSAGE_RECORD_ID")
    private Integer tmMessageRecordId;

    /**
     * 消息发送者ID
     */
    @TableField("SEND_OUT_USER_ID")
    private Integer sendOutUserId;

    /**
     * 消息接收者ID
     */
    @TableField("RECEIVE_USER_ID")
    private Integer receiveUserId;

    /**
     * 0:标识群聊，1:标识私聊
     */
    @TableField("TYPE")
    private Integer type;

    /**
     * 群聊名称
     */
    @TableField("GROUP_NAME")
    private String groupName;

    /**
     * 已读标识0：表示未读，1：表示已读
     */
    @TableField("READ_STATUS")
    private Integer readStatus;

    /**
     * 消息内容
     */
    @TableField("MSG")
    private String msg;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private Date createTime;

    /**
     * 创建用户名
     */
    @TableField("CREATE_USERNAME")
    private String createUsername;

    /**
     * 最后更新时间
     */
    @TableField("LAST_UPDATE_TIME")
    private Date lastUpdateTime;

    /**
     * 最后更新人
     */
    @TableField("LAST_UPDATE_USERNAME")
    private String lastUpdateUsername;

    /**
     * 发送时间
     * @return
     */
    @TableField("SEND_TIME")
    private Date sendTime;
    @Override
    public String toString() {
        return "MessageRecordEntity{" +
                "tmMessageRecordId=" + tmMessageRecordId +
                ", sendOutUserId=" + sendOutUserId +
                ", receiveUserId=" + receiveUserId +
                ", type=" + type +
                ", groupName=" + groupName +
                ", readStatus=" + readStatus +
                ", msg=" + msg +
                ", createTime=" + createTime +
                ", createUsername=" + createUsername +
                ", lastUpdateTime=" + lastUpdateTime +
                ", lastUpdateUsername=" + lastUpdateUsername +
                "}";
    }
}
